import { Component, OnInit } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { SystemConfigService } from '@core/services/system-config.service';

@Component({
  selector: 'app-person-password',
  templateUrl: './person-password.component.html',
  styleUrls: ['./person-password.component.less']
})
export class PersonPasswordComponent implements OnInit {

  public myGroup: FormGroup;
  public passInfos : any = {
    oldPassword: '',
    newPassword: '',
  };
  public surePass : any;

  constructor(private systemService: SystemConfigService, private fb: FormBuilder) { }




  submit(){
    console.log(this.passInfos);
    this.systemService.putPassowrd(this.passInfos).then((data: any) => {

    }, data => {
    });
  };
  ngOnInit() {
    this.myGroup = this.fb.group({
      oldPassword: [ null, [ Validators.required ] ],
      newPassword: [ null, [ Validators.required ] ],
      surePass: [ null, [ Validators.required ] ]
    });
  }
}
